using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class WaybillComplaintLogMap : EntityTypeConfiguration<WaybillComplaintLog>
	{
		public WaybillComplaintLogMap()
		{
			// Primary Key
			this.HasKey(t => t.LogId);

			// Properties
			this.Property(t => t.CommandPerson)
				.HasMaxLength(20);
				
			this.Property(t => t.CommandInfo)
				.HasMaxLength(40);
				
			this.Property(t => t.Remark)
				.HasMaxLength(200);
				
			this.Property(t => t.UndoReson)
				.HasMaxLength(55);
				
			this.Property(t => t.ValidReason)
				.HasMaxLength(55);
				
			this.Property(t => t.AppearReason)
				.HasMaxLength(55);
				
			// Table & Column Mappings
			this.ToTable("WaybillComplaintLog");
			this.Property(t => t.LogId).HasColumnName("LogId");
			this.Property(t => t.WaybillComplaintId).HasColumnName("WaybillComplaintId");
			this.Property(t => t.CommandTime).HasColumnName("CommandTime");
			this.Property(t => t.CommandPerson).HasColumnName("CommandPerson");
			this.Property(t => t.CommandInfo).HasColumnName("CommandInfo");
			this.Property(t => t.Remark).HasColumnName("Remark");
			this.Property(t => t.Isvalid).HasColumnName("Isvalid");
			this.Property(t => t.UndoReson).HasColumnName("UndoReson");
			this.Property(t => t.ValidReason).HasColumnName("ValidReason");
			this.Property(t => t.AppearReason).HasColumnName("AppearReason");
		}
	}
}

